import 'package:flutter/material.dart';

class ExpandedComp extends StatelessWidget {
  const ExpandedComp({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
     appBar: AppBar(title: const Text('Expanded布局'), backgroundColor: Colors.red,),
     body: Center(
      child: Container(
        height: 100,
        color: const Color.fromARGB(255, 173, 179, 180),
        child: Row(
          children: [
            // 占1/7
            Expanded(
              flex: 1,
              child: Container(
                height: 86,
                color: Colors.red,
              )
            ),
            // 占4/7
            Expanded(
                flex: 4,
                child: Container(
                height: 86,
                color: Colors.green,
              )
            ),
            // 占2/7
            Expanded(
              flex: 2,
              child: Container(
                height: 86,
                color: Colors.pink,
              )
            ),
          ],
        ),
      ),
     ),
    );
  }
}